package fr.emn.integration.synthese.controle;

import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;

import javax.swing.JButton;

import fr.emn.integration.synthese.abstraction.Cours;
import fr.emn.integration.synthese.presentation.HistoriqueDialog;

public class ControlJButtonHistorique implements ActionListener{

	Cours modele;
	JButton historiqueEval;
	Frame parent;
	
	public ControlJButtonHistorique(Frame parent, Cours modele, JButton historiqueEval) {
		this.parent = parent;
		this.modele = modele;
		this.historiqueEval = historiqueEval;
	}

	@Override
	public void actionPerformed(ActionEvent arg0) {

		try {
			HistoriqueDialog hisdialog = new HistoriqueDialog (parent,modele);
			this.modele.addObserver(hisdialog);
			hisdialog.setVisible(true);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
	}

}
